﻿#include <iostream>
using namespace std;

template <class Type>
Type maxof(const Type x[], int n)
{
	Type max = x[0];
	for (int i = 1; i < n; i++) {
		if (x[i] > max) {
			max = x[i];
		}
	}
	return max;
}

int main() {
	const int isize = 3;
	int ix[isize] = { 1,2,3 };
	cout << "最大值：" << maxof(ix, isize) << endl;

	double dx[isize] = { 1.0, 2.0,3.0 };
	cout << "最大值：" << maxof(dx, isize) << endl;

	cin.get();
}